/************************************************************************
 *
 * string.h
 *
 * (c) Copyright 1996-2008 Analog Devices, Inc.  All rights reserved.
 * $Revision: 6 $
 ************************************************************************/

#pragma once
#ifndef __NO_BUILTIN
#pragma system_header /* string.h */
#endif

#ifndef __STRING_DEFINED
#define __STRING_DEFINED

#ifndef _YVALS
 #include <yvals.h>
#endif


#ifdef __TS_BYTE_ADDRESS
#include <byteaddrdef.h>
#endif

#ifndef NULL
  #ifdef __cplusplus
    #define NULL	0
  #else
    #define NULL	((void *)0)
  #endif
#endif

#if !defined(__SIZE_T_DEFINED) && !defined(_SIZET)
  #define __SIZE_T_DEFINED
  #define _SIZET
  typedef _Sizet size_t;
#endif

#ifdef __cplusplus
  extern "C" {
#endif

void   *__builtin_memcpy(void *_dest, const void *_src, size_t _n);
void   *memcpy(void *_dest, const void *_src, size_t _n);

void   *__builtin_memmove(void *_dest, const void *_src, size_t _n);
void   *memmove(void *_dest, const void *_src, size_t _n);

int     memcmp(const void *_s1, const void *_s2, size_t _n);
void   *memchr(const void *_s1, int _c, size_t _n);
void   *memset(void *_s1, int _c, size_t _n);
 
char   *__builtin_strcpy(char *_dest, const char *_src);
char   *strcpy (char *_dest, const char *_src);
char   *strncpy(char *_dest, const char *_src, size_t _n);

char   *strcat (char *_s1, const char *_s2);
char   *strncat(char *_s1, const char *_s2, size_t _n);

int     strcmp (const char *_s1, const char *_s2);
int     strncmp(const char *_s1, const char *_s2, size_t _n);

int     strcoll(const char *_s1, const char *_s2);
size_t  strxfrm(char *_s1, const char *_s2, size_t _n);

char   *strchr(const char *_s1, int _c);
char   *strrchr(const char *_s1, int _c);

size_t  strspn(const char *_s1, const char *_s2);
size_t  strcspn(const char *_s1, const char *_s2);

char   *strpbrk(const char *_s1, const char *_s2);
char   *strstr(const char *_s1, const char *_s2);
char   *strtok(char *_s1, const char *_s2);

size_t  __builtin_strlen(const char *_s1);
size_t  strlen(const char *_s1);

char   *strerror(int _errnum);

#if !defined(__NO_BUILTIN)
#ifdef __TS_BYTE_ADDRESS
#define strcpy_ba  __builtin_strcpy
#define strlen_ba __builtin_strlen
#define memcpy_ba __builtin_memcpy
#define memmove_ba __builtin_memmove
#else
#define strcpy  __builtin_strcpy
#define strlen __builtin_strlen
#define memcpy __builtin_memcpy
#define memmove __builtin_memmove
#endif
#endif

#ifdef __cplusplus
  }
#endif

#endif /* __STRING_DEFINED */
